-
-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spinachboul update function #457
Spinachboul update function #457
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #457 +/- ##
=======================================
Coverage 78.12% 78.12%
=======================================
Files 23 23
Lines 3154 3155 +1
=======================================
+ Hits 2464 2465 +1
Misses 690 690 ☔ View full report in Codecov by Sentry. |
@ChrisRackauckas and @sathvikbhagavan |
docs/src/tensor_prod.md
Outdated
![kriging](https://github.com/Spinachboul/Surrogates.jl/assets/105979087/906e6688-db47-48be-90d1-ea471aacac16) | ||
|
||
## Lobachevsky Plot | ||
|
||
![lobachevsky](https://github.com/Spinachboul/Surrogates.jl/assets/105979087/678cfc13-0aec-4488-8e4d-39649853ecdd) | ||
|
||
## Combined Plot | ||
|
||
![combined_plot](https://github.com/Spinachboul/Surrogates.jl/assets/105979087/46762f0d-50c5-4d6c-961a-236fd9fb3ad5) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is unrelated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I see, but the docs already generate these plots.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that's right! I attached the plots for reference about Kriging and Lobachevsky individually, and their plotting curves. And can't we attach plots both, in the readme and the docs??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I don't recommend attaching plots but instead running code to generate them
docs/src/Improvedgekpls.md
Outdated
# GEKPLS Function | ||
|
||
Gradient Enhanced Kriging with Partial Least Squares Method (GEKPLS) is a surrogate modelling technique that brings down computation time and returns improved accuracy for high-dimensional problems. The Julia implementation of GEKPLS is adapted from the Python version by [SMT](https://github.com/SMTorg) which is based on this [paper](https://arxiv.org/pdf/1708.02663.pdf). | ||
|
||
# Modifications for Improved GEKPLS Function: | ||
|
||
To enhance the GEKPLS function, sampling method was changed from ```SobolSample()``` to ```HaltonSample()```. | ||
|
||
|
||
```@example gekpls_water_flow | ||
|
||
using Surrogates | ||
using Zygote | ||
|
||
function water_flow(x) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just GEKPLS, why would it have a different page?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I added that in the Pages.jl for the modifications I made in the new file, I will remove it!
docs/src/Improvedgekpls.md
Outdated
| **Sampling Method** | **RMSE** | **Differences** | | ||
|----------------------|--------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ||
| **Sobol Sampling** | 0.021472963465423097 | Utilizes digital nets to generate quasi-random numbers, offering low discrepancy points for improved coverage. - Requires careful handling, especially in higher dimensions. | | ||
| **Halton Sampling** | 0.02144270998045834 | Uses a deterministic sequence based on prime numbers to generate points, allowing for quasi-random, low-discrepancy sampling. - Simpler to implement but may exhibit correlations in some dimensions affecting coverage. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is more for QuasiMonteCarlo.jl
docs/src/Improvedgekpls.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like we talked about in #456, GEKPLS is independent from sampling method and the notion of improvement in accuracy depends on the original problem itself and what sampling works better. There is no general recipe for making it better. So, I don't think this tutorial is adding any new value and should be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sathvikbhagavan
Your'e right! If anything, we could have better optimization techniques to improve in gekpls.jl, instead of solely focusing on sampling methods! So, I have removed the file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you have removed it. You might have forgot to push it. Look at the diff and commits to confirm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete Improvedgekpls.md
and then we can merge this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I have deleted the file Improvedgekpls.md
Please check once again if all the changes are suitable for merging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ChrisRackauckas and @sathvikbhagavan
Is this PR ready for merging? Or still there are things which need to be modified??
docs/src/tensor_prod.md
Outdated
|
||
## Kriging Plot | ||
|
||
![kriging](https://github.com/Spinachboul/Surrogates.jl/assets/105979087/906e6688-db47-48be-90d1-ea471aacac16) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is necessary. The plots would be generated from the above code block. Are you doing anything new, as in what code produces this plot?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't do anything new logically in the code, just added in some explanation about the tensor product function which I thought would be relevant and added the plots , i will remove if it is not required!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, remove them
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sathvikbhagavan
But then, shouldn't we add more mathematical explanation to improve our readme file, simply stating the function would be too vague for the viewers!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand the usefulness of the plots. They don't provide any new information either. Look at the current plot in the tutorial - https://docs.sciml.ai/Surrogates/stable/tensor_prod/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, so for now, I just need to focus on adding mathematical explanations in the tutorials right?
So soon I'll share a sample file (won't hit a PR for this) and then request your approval if it is going along the correct lines.
Please then suggest to me the correct blend of theory and math explanations which would enable me to work efficiently.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. Feel free to open up a PR and continue working. Make it a draft PR and you can push in commits. When you are ready, make it ready for review and ping me. I will take a look. Hopefully you are more comfortable in the ecosystem and how things work in SciML.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah! I am actually getting to know SciML codebase better. Thanks for your guidance throughout this time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @ChrisRackauckas and @sathvikbhagavan
Please let me know if this explanation suits well with the Kriging Model!
I was wondering if this is how we could expand the docs in the tutorials section!!
(Please forgive for the bad handwriting!! 😅)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And please also suggest models on which I could work! I mean there are many out there but the ones which are important and really catch reader's eye.
|
||
For instance, consider a tensor product function defined as follows: | ||
|
||
```\[ f(x) = ∏ᵢ=₁ᵈ cos(aπxᵢ) \]``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this different from what it was before?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it is the same just in a more readable form than before, the limits and the function, which we usually write!
As earlier it was a bit confusing as to what the actual function is!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, then its fine
docs/src/tensor_prod.md
Outdated
@@ -1,6 +1,5 @@ | |||
# Tensor product function | |||
The tensor product function is defined as: | |||
``f(x) = \prod_{i=1}^d \cos(a\pi x_i)`` | |||
The tensor product function is defined as: ```\[ f(x) = ∏ᵢ=₁ᵈ cos(aπxᵢ) \]``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But this isn't correct. This is one example of a tensor product.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that is true. Maybe we specifically say it is one of the possible forms. I think this was taken from https://smt.readthedocs.io/en/latest/_src_docs/problems/tensorproduct.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, @ChrisRackauckas and @sathvikbhagavan
Should we properly define the tensor product function like this:
Or just stating this example would be fine??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that would do it. But do we have an actual issue that is being solved here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As the benchmarks need some cleanup, I think we can startoff with this PR to clean up the tensor product benchmark? Although I am not sure why would we need a surrogate for computing tensor product 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sathvikbhagavan
I think there would be a couple of factors as to why surrogates could be used to compute tensor product:
- Computational Complexity would be decreased
- Efficient memory handling
- Normalization of products of tensors which provide numerical stability
This PR #457 only consists of changing the example of tensor product into a more readable form up till now, but I would also work towards explaining the mathematical concepts behind surrogate models in my draft PR as we discussed earlier.
Changes Made